import { defineConfig } from '@tarojs/cli';
import version from './version';

module.exports = defineConfig({
  env: {
    NODE_ENV: '"production"',
  },
  defineConstants: {
    BUILD_ENV: '"pro"',
    API_URL: '"http://www.fly.com"',
    VERSION: version.VERSION,
    SIGN_KEY: version.SIGN_KEY,
    APP_ID: version.APP_ID,
    OSS_URL: version.OSS_URL,
  },
  mini: {},
  h5: {
    /**
     * 如果h5端编译后体积过大，可以使用webpack-bundle-analyzer插件对打包体积进行分析。
     * 参考代码如下：
     * webpackChain (chain) {
     *   chain.plugin('analyzer')
     *     .use(require('webpack-bundle-analyzer').BundleAnalyzerPlugin, [])
     * }
     */
  },
});
